package com.yeshen.pmtea.beans;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by Administrator on 2016/11/15.
 */

public class DBHelper extends SQLiteOpenHelper {
    private Context context;
    private static DBHelper dbHelper;
    public static final String DBNAME="chabaike.db";
    public static final int DATABASE_VERSION = 1;
    public static final String TABLE_NAME_collect="collect";
    //创建一个用于我的收藏的数据裤,来存放数据
    private static final String sql_collect="CREATE TABLE IF NOT EXISTS "
            +TABLE_NAME_collect+ " ("
            +"_id INTEGER PRIMARY KEY AUTOINCREMENT,"
            +"id INTEGER UNIQUE NOT NULL,"
            +"title VARCHAR(50),"
            +"source VARCHAR(50),"
            +"description VARCHAR(50),"
            +"wap_content TEXT,"
            +"create_time VARCHAR(50),"
            +"nickname VARCHAR(50)"+");";

    public DBHelper(Context context ) {
        super(context, DBNAME, null, DATABASE_VERSION);
        this.context = context;
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(sql_collect);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
